package com.common.core.exception.code;


import lombok.Getter;
import lombok.Setter;

/**
 * @auther zhangwj
 * @date 2021/7/26 上午11:04
 * @说明 类型+场景+自定义标识
 * 参数异常 P_XX_XX    P_CAMPAIGN_NameNotNull:运营活动名不能为空
 * 业务异常 B_XX_XX    B_CAMPAIGN_NameAlreadyExist: 运营活动名已存在
 * 系统异常 S_XX_ERROR S_DATABASE_ERROR: 数据库错误
 * 鉴权异常 A_XX    A_ACCESS_DENIED: 拒绝访问
 * OSS对象存储异常OSS_XX OSS_ERROR
 */
@Getter
public class BaseErrorCode {

    public static BaseErrorCode SUCCESS = new BaseErrorCode(200, "服务调用成功");
    public static BaseErrorCode ERROR = new BaseErrorCode(-1, "系统异常");
    public static BaseErrorCode BIZ_EXCEPTION_CODE = new BaseErrorCode(-2, "业务异常");
    public static BaseErrorCode SYS_EXCEPTION_CODE = new BaseErrorCode(-3, "系统服务异常");

    private final int errNum;

    @Setter
    private String errMsg;

    public BaseErrorCode(int errNum, String errMsg) {
        this.errNum = errNum;
        this.errMsg = errMsg;
    }
}
